using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;

namespace Zombie.Services.Definitions
{
	internal class Helpers
	{
		public static Dictionary<string, PropertyChangedEventArgs> BuildEventArgsDictionary(Type type)
		{

#if NETFX_CORE
			var properties = type.GetRuntimeProperties();
#else
			var properties = type.GetProperties();
#endif
			var result = new Dictionary<string, PropertyChangedEventArgs>(properties.Count());
			foreach (var property in properties)
			{
				result[property.Name] = new PropertyChangedEventArgs(property.Name);
			}
			return result;
		}
	}
}
